<template>
	<view>
		<up-popup :show="showPopup" closeable :round="round" :mode="mode" @close="close" @open="open">
			<view class="popup-wrap" :style="{ height: height }">
				<view class="close-popup-title">{{ title }}</view>
				<slot></slot>
				<!-- <view></view> -->
			</view>
		</up-popup>
	</view>
</template>

<script setup>
import { ref, onMounted } from "vue";
const props = defineProps({
	title: {
		type: String,
		default: ""
	},
	mode: {
		type: String,
		default: "bottom"
	},
	round: {
		type: Number,
		default: 20
	},
	height: {
		type: String,
		default: "50vh"
	},
	// show: {
	// 	type: Boolean,
	// 	default: false
	// }
});

const showPopup = ref(false);
const emit = defineEmits(["select"]);
const select = ref("");
const open = () => {
	showPopup.value = true;
};

const close = () => {
	showPopup.value = false;
};

const confirm = () => {
	emit("select", props.list[select.value]);
	close();
};

const selectStore = (index) => {
	select.value = index;
};


onMounted(() => { });

defineExpose({ open, close });
</script>

<style scoped lang="less">
.close-popup-title {
	font-size: 32rpx;
	font-weight: 600;
	color: #000;
	margin-top: 20rpx;
	width: 100%;
	text-align: center;
}
</style>
